package com.suman.rss;

import java.util.ArrayList;
import java.util.List;

public class RssFeed {
	
	private List<FeedItem> feedList = new ArrayList<FeedItem>();
	
	public void addFeedItem(FeedItem feedItem){
		feedList.add(feedItem);
	}

	public void setFeedList(List<FeedItem> feedList) {
		this.feedList = feedList;
	}

	public List<FeedItem> getFeedList() {
		return feedList;
	} 
	
	public FeedItem getFeedItemBasedOnTitle(String title){
		FeedItem matchedFeedItem = null;
		for(FeedItem feedItem:feedList){
			if(title.equalsIgnoreCase(feedItem.getTitle())){
				matchedFeedItem = feedItem;	
				break;
			}
		}
		return matchedFeedItem;
	}
	

}
